<%layout("/common/_layout.html"){ %>
  <%#ajax userTable:{%>
  <div class="am-cf am-padding">
    <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">系统管理</strong> / <small>资费业务管理</small></div>
  </div>
    <form class="am-form" id="listForm" action="${base}/business/list" method="post">
  <div class="am-g">
    <div class="am-u-sm-12">
      <table class="am-table am-table-bordered am-table-radius table-main">
        <tbody>
          <tr>
            <th class="am-text-middle">所属企业</th>
            <td>
               <div class="am-u-sm-10">
                  <select data-am-selected="{btnSize: 'sm'}">
                    <option value="option1">大掌柜</option>
                  </select>
              </div>
            </td>
            <th class="am-text-middle">是否启用</th>
            <td>
              <div class="am-u-sm-10">
                <select name="enabled" id="enabled" data-am-selected="{btnSize: 'sm'}" >
                <option value="-1" 
                <%if (enabled=="-1"){%>
	               selected = "selected"
	            <%}%>
                  >所有</option>
                  
                <option value="1" 
                <%if (enabled=="1"){%>
                   selected = "selected"
                <%}%>
                  >是</option>
                  
                <option value="0" 
                <%if (enabled=="0"){%>
                   selected = "selected"
                <%}%>
                  >否</option>
                  
                </select>
 
                <input type="hidden"  id="search_enabled" class="am-form-field am-input-sm" value=${enabled!}>
              </div>
            </td>
          </tr>
         
          <tr>
            <th class="am-text-middle">业务名称关键字</th>
            <td>
              <div class="am-u-sm-10">
                <input type="text" name="businessName" id="businessName" class="am-form-field am-input-sm" value="${businessName!}">
                <input type="hidden" class="am-input-sm"  id="search_businessName" value="${businessName!}"/>
              </div>
            </td>
            <th class="am-text-middle">业务代码关键字</th>
            <td>
              <div class="am-u-sm-10">
                <input type="text" name="businessCode" id="businessCode" class="am-form-field am-input-sm" value="${businessCode!}">
                <input type="hidden" class="am-input-sm"  id="search_businessCode" value="${businessCode!}"/>
              </div>
            </td>
          </tr>
          <tr>
              <td colspan="4">
                <div align='right'>
                  <button type="sumbit"  class="am-btn am-btn-default am-btn-sm am-text-secondary">搜索</button>
                </div>
              </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
   </form>
  
   <div class="am-g">
     <div class="am-u-sm-12 am-u-md-6" style="padding:0px 3rem 0rem 1rem;margin:0px;">
       <div class="am-btn-toolbar">
         <div class="am-btn-group am-btn-group-xs">
        <%if(so.hasPermission("BUSINESS_ADD")) {%>
           <button type="button" class="am-btn am-btn-default" onclick="location.href='${base}/business/add'"><span class="am-icon-plus"></span> 新增</button>
        <%}%>
        <%if(so.hasPermission("BUSINESS_DELETE")) {%>
        <button type="button" id="deleteButton" disabled="disabled" class="am-btn am-btn-default"  onclick="deleteAll('${base}/business/delete')"><span class="am-icon-trash-o"></span> 删除</button>
        <%}%> 
         </div>
       </div>
     </div>
</div>
   <div class="am-g">
     <div class="am-u-sm-12">
       <div class="am-scrollable-horizontal">
         <table class="am-table am-table-striped am-table-hover table-main">
             <thead>
                 <tr class="am-text-nowrap">
                     <th class="table-check"><input type="checkbox"  id="allCheck"/></th><th class="table-title">业务名称</th><th class="table-title">业务代码</th><th class="table-title">是否启用</th>
                     <%if(so.hasPermission("BUSINESS_EDIT")) {%>
                     <th class="table-title">操作</th>
                     <%}%>
                 </tr>
             </thead>
          <tbody>
             <%for(list in pager.list!){%>
                <tr>
                 <td><input type="checkbox" name="ids" value="${list.id}"></td>
                 <td>${list.businessName}</td>
                 <td>${list.businessCode}</td>
                 <td>
                    <%if (list.enabled==1){%>
                                                                               已启用
                    <%}else{%>
                                                                              未启用
                    <%}%>
                 </td>
                  <%if(so.hasPermission("BUSINESS_EDIT")) {%>
                 <td>
                 <button onclick="location.href='${base}/business/edit?id=${list.id}'" type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" ><span class="am-icon-pencil-square-o"></span>编辑</button>
                 </td>    
                 <%}%>   
               </tr>
             <%}%> 
          </tbody>
       </table>
       </div>
        <div class="am-cf">
           <!-- 分页 -->
           <%if (pager.list.~size > 0){%>
               <div class="am-fr">
                   <% include("/admin/business_pager.tpl"){}%>
               </div>
           <%}else{%>
               <div class="am-kai">
                 <h3>没有找到任何记录!</h3>
               </div>
           <%}%>
        </div>
       <%}%>
     </div>
   </div>

 
<%}%>



